package com.chen.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author chenchao
 * @date 2022/9/5 21:19
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(collection="demo")
public class Demo implements Serializable {

    @Id
    private String id;

    @Field("name")
    private String name;

    @Field("salary")
    private Integer salary;

    @TableField(fill = FieldFill.INSERT)
//    @DateTimeFormat(pattern = "yyy-MM-dd HH:mm:ss")
    private Date birthday;

    @Field("address")
    private String address;

    @Field("age")
    private Integer age;


}
